# include "circulo.h"

using namespace std;

void
Circulo::trasladar(float x, float y)
{
	c.trasladar(x,y);
}

void
Circulo::redimensionar(float x, float y = 0)
{
	r = (r + x - y);
}

bool
Circulo::seleccionar(float x, float y) // Click dentro
{
	bool ret = false;
	 
	if ((x > ((c.getX() - abs(r)))) && (x < ((c.getX() + abs(r)))) && (y > ((c.getY() - abs(r)))) && (y < ((c.getY() + abs(r)))))
	{
		ret = true;
	}	
	
	return (ret);
}

bool
Circulo::contenida(Punto a, Punto b)
{
	bool ret = false;
	 
	if ((a.getX() <= (c.getX() - abs(r))) && (b.getX() >= (c.getX() + abs(r))) && (b.getY() <= (c.getY() - abs(r))) && (a.getY() >= (c.getY() + abs(r))))
	{
		ret = true;
	}
	
	return (ret);
}	
